var express = require("express");
var bodyParser = require('body-parser')
var router = require("./router.js");

var app = express();
//配置公共资源
app.use('/public/', express.static('./public/'))
app.use('/node_modules/', express.static('./node_modules/'))
//配置模板引擎
app.engine('html', require('express-art-template'));
//配置post请求参数获取
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

//将路由挂载到app服务中
app.use(router);

var port = 12345;
app.listen(port,function(){
	console.log("服务器已启动,port:"+port);
});